/*
 * @Author: your name
 * @Date: 2021-06-03 23:38:51
 * @LastEditTime: 2021-06-03 23:44:21
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /qiankun/qiankun-react/.rescriptsrc.js
 */
const { name } = require("./package");

module.exports = {
  webpack: (config) => {
    config.output.library = `${name}-[name]`;
    config.output.libraryTarget = "umd";
    config.output.jsonpFunction = `webpackJsonp_${name}`;
    config.output.globalObject = "window";

    return config;
  },

  devServer: configFunction => {
    return function (proxy, allowedHost) {
      const config = configFunction(proxy, allowedHost);
      config.port = 3000;
      config.headers = {
        "Access-Control-Allow-Origin": "*",
      };
      return config;
    };
  },
};
